//
//  NomralCell.swift
//  Sina
//
//  Created by 管观荣 on 15/9/28.
//  Copyright © 2015年 CHer. All rights reserved.
//

import UIKit

class NomralCell: HomeCell {

    override var viewModel :HomeViewModel? {
        didSet {
            // 修改配图视图高度
            pictureView.snp_updateConstraints { (make) -> Void in
                // 使用计算完成的大小，设置约束数值！
                make.width.equalTo(pictureView.bounds.width)
                make.height.equalTo(pictureView.bounds.height)
                
                let offset = (pictureView.bounds.height == 0) ? 0 : WBHomeCellMargin
                make.top.equalTo(contentLabel.snp_bottom).offset(offset)
            }
        }
    }
    
    override func setupUI (){
        super.setupUI()
        
        pictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(contentLabel.snp_bottom).offset(WBHomeCellMargin)
            make.left.equalTo(contentLabel.snp_left)
            make.width.equalTo(290)
            make.height.equalTo(290)
        }
    }

}
